{% extends "base_generic.html" %}

{% block content %}
  <h1>作者列表</h1>
  <ul>
    {% for author in author_list %}
      <li>
        <a href="{% url 'author-detail' author.pk %}">{{ author.last_name }}, {{ author.first_name }}</a>
      </li>
    {% endfor %}
  </ul>
  {% if is_paginated %}
    <div>
      {% if page_obj.has_previous %}
        <a href="?page=1">首页</a>
        <a href="?page={{ page_obj.previous_page_number }}">上一页</a>
      {% endif %}
      <span>第 {{ page_obj.number }} 页，共 {{ page_obj.paginator.num_pages }} 页</span>
      {% if page_obj.has_next %}
        <a href="?page={{ page_obj.next_page_number }}">下一页</a>
        <a href="?page={{ page_obj.paginator.num_pages }}">末页</a>
      {% endif %}
    </div>
  {% endif %}
{% endblock %}
